home *** CD-ROM | disk | FTP | other *** search
/ MacGames Sampler / PHT MacGames Bundle.iso / MacSource Folder / Samples from the CD / Assembly / Mac68k / MANUAL / MAN5.DOC < prev    next >
Encoding:
Text File  |  1985-08-11  |  12.1 KB  |  559 lines  |  [TEXT/Anon]

  1.  
  2. MAC.68K
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.                                 BSS
  10.                                 BSS
  11.                                 BSS
  12.  
  13.  
  14.  
  15.  
  16.   PURPOSE         To switch assembly into the block storage segment.
  17.  
  18.  
  19.  
  20.  
  21.   FORMAT               BSS
  22.  
  23.  
  24.  
  25.  
  26.   DESCRIPTION     BSS changes the current assembly segment to the
  27.  
  28.  
  29.                block storage segment. Instructions and data
  30.  
  31.  
  32.                generating op codes may not be used within this
  33.  
  34.  
  35.                segment. Storage may be allocated and symbols defined
  36.  
  37.  
  38.                by using the DS op codes.
  39.  
  40.  
  41.  
  42.  
  43.  
  44.   EXAMPLE              BSS
  45.  
  46.  
  47.                BUFF    DS       128
  48.  
  49.  
  50.                NAME    DS.B     8
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.                                 COMM
  61.                                 COMM
  62.                                 COMM
  63.  
  64.  
  65.  
  66.  
  67.   PURPOSE         To declare a common area.
  68.  
  69.  
  70.  
  71.  
  72.   FORMAT               COMM   label,expression
  73.  
  74.  
  75.  
  76.  
  77.   DESCRIPTION     COMM specifies a symbol name (label) and a length
  78.  
  79.  
  80.                (expression) to be set up as a shared area with other
  81.  
  82.  
  83.                programs. The link utility LO68 (CPM-68K only) will
  84.  
  85.  
  86.                establish one starting address for all common areas
  87.  
  88.  
  89.                with the same label name. The length of this area will
  90.  
  91.  
  92.                be the largest value specified from the linked
  93.  
  94.  
  95.                programs.
  96.  
  97.  
  98.  
  99.  
  100.  
  101.   EXAMPLES
  102.  
  103.  
  104.                      COMM     BUFFER,$100
  105.  
  106.  
  107.                      COMM     FOO,2
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.                               -21-                              MAC.68K
  119.  
  120.  
  121.  
  122.                                                                 MAC.68K
  123.  
  124.  
  125.  
  126.  
  127.  
  128.                                 DATA
  129.                                 DATA
  130.                                 DATA
  131.  
  132.  
  133.  
  134.  
  135.  
  136.   PURPOSE         To switch assembly into the data segment.
  137.  
  138.  
  139.  
  140.  
  141.  
  142.   FORMAT               DATA
  143.  
  144.  
  145.  
  146.  
  147.  
  148.   DESCRIPTION     DATA changes the current assembly segment to the
  149.  
  150.  
  151.                data segment. Any data, instruction, or reservation op
  152.  
  153.  
  154.                code may be used within the DATA segment.
  155.  
  156.  
  157.  
  158.  
  159.  
  160.   EXAMPLE              DATA
  161.  
  162.  
  163.               ANAME    DC.L     'QUIRK'
  164.  
  165.  
  166.               BOOKS    DS       120
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206. MAC.68K                                  -22-
  207.  
  208.  
  209.  
  210. MAC.68K
  211.  
  212.  
  213.  
  214.  
  215.  
  216.                                 DC
  217.                                 DC
  218.                                 DC
  219.  
  220.  
  221.                                 DC.B
  222.                                 DC.B
  223.                                 DC.B
  224.  
  225.  
  226.                                 DC.L
  227.                                 DC.L
  228.                                 DC.L
  229.  
  230.  
  231.  
  232.  
  233.  
  234.   PURPOSE         To declare data values.
  235.  
  236.  
  237.  
  238.  
  239.  
  240.   FORMAT       symbol  DC     expression
  241.  
  242.  
  243.  
  244.  
  245.  
  246.   DESCRIPTION     DC places the value of expression into one or more
  247.  
  248.  
  249.                word, byte, or long word memory locations. Numeric
  250.  
  251.  
  252.                data types are placed into a single unit of the
  253.  
  254.  
  255.                specified memory size. Character data types are
  256.  
  257.  
  258.                aligned and placed into however many units of sized
  259.  
  260.  
  261.                memory necessary to contain the entire string.  DC and
  262.  
  263.  
  264.                DC.L are automatically aligned to an even word
  265.  
  266.  
  267.                boundary.  DC.B may begin on an odd byte boundary.
  268.  
  269.  
  270.  
  271.  
  272.  
  273.   EXAMPLES
  274.  
  275.  
  276.               DATE    DC     10L 04/21/78
  277.  
  278.  
  279.               TIME    DC.L   #L* 11:34 *
  280.  
  281.  
  282.               LIST    DC.B   'A','Z',0
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.                               -23-                              MAC.68K
  315.  
  316.  
  317.  
  318.                                                                 MAC.68K
  319.  
  320.  
  321.  
  322.  
  323.  
  324.                                DEFER
  325.                                DEFER
  326.                                DEFER
  327.  
  328.  
  329.  
  330.  
  331.  
  332.   PURPOSE         To define a block of source line input that is to be
  333.  
  334.  
  335.                saved and then inserted later.
  336.  
  337.  
  338.  
  339.  
  340.  
  341.   FORMAT               DEFER
  342.  
  343.  
  344.              defname   DEFER
  345.  
  346.  
  347.  
  348.  
  349.  
  350.   DESCRIPTION     DEFER marks the beginning and end of a block of
  351.  
  352.  
  353.                code that is to be appended to an internal buffer.
  354.  
  355.  
  356.                Multiple named DEFER buffers may be active and are
  357.  
  358.  
  359.                specified by use of the defname in the location field
  360.  
  361.  
  362.                of the beginning DEFER.  A subsequent HERE pseudo op
  363.  
  364.  
  365.                empties the specified buffer, and the accumulated
  366.  
  367.  
  368.                block(s) of code are assembled. DEFERs cannot be
  369.  
  370.  
  371.                nested.
  372.  
  373.  
  374.  
  375.                    Defered code is saved in memory buffers until it
  376.  
  377.  
  378.                is used. The number of active buffers and the amount
  379.  
  380.  
  381.                of code in them is limited only by available memory
  382.  
  383.  
  384.                space.
  385.  
  386.  
  387.  
  388.  
  389.  
  390.   EXAMPLES         see example for pseudo op HERE
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420. MAC.68K                                  -24-
  421.  
  422.  
  423.  
  424. MAC.68K
  425.  
  426.  
  427.  
  428.  
  429.  
  430.                                 DS
  431.                                 DS
  432.                                 DS
  433.  
  434.  
  435.                                 DS.B
  436.                                 DS.B
  437.                                 DS.B
  438.  
  439.  
  440.                                 DS.L
  441.                                 DS.L
  442.                                 DS.L
  443.  
  444.  
  445.  
  446.  
  447.  
  448.   PURPOSE         To reserve storage.
  449.  
  450.  
  451.  
  452.  
  453.  
  454.   FORMAT               DS     expression
  455.  
  456.  
  457.              symbol    DS     expression
  458.  
  459.  
  460.  
  461.  
  462.  
  463.   DESCRIPTION     DS reserves expression number of words, bytes, or
  464.  
  465.  
  466.                long words in memory. If a symbol is used in the
  467.  
  468.  
  469.                location field it is assigned the current value of the
  470.  
  471.  
  472.                location counter. DS and DS.L are automatically
  473.  
  474.  
  475.                aligned to an even word boundary. DS.B may begin on an
  476.  
  477.  
  478.                odd byte boundary.
  479.  
  480.  
  481.  
  482.  
  483.  
  484.   EXAMPLES
  485.  
  486.  
  487.               BUFFER   DS.B    $128
  488.  
  489.  
  490.                        DS      4
  491.  
  492.  
  493.               FILENAME DS.L    2
  494.  
  495.  
  496.               ALIGN    DS.W    0
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.                               -25-                              MAC.68K
  529.  
  530.  
  531.  
  532.                                                                 MAC.68K
  533.  
  534.  
  535.  
  536.  
  537.  
  538.                                 DUP
  539.                                 DUP
  540.                                 DUP
  541.  
  542.  
  543.  
  544.  
  545.  
  546.   PURPOSE         To define a block of code that is to be duplicated.
  547.  
  548.  
  549.  
  550.  
  551.  
  552.   FORMAT               DUP    dupcount
  553.  
  554.  
  555.              dupname   DUP    dupcount
  556.  
  557.  
  558.  
  559.  
  560.  
  561.   DESCRIPTION     DUP marks the beginning of a block of code
  562.  
  563.  
  564.                terminated by an ENDD. The expression dupcount
  565.  
  566.  
  567.                specifies the number of times the block is to be
  568.  
  569.  
  570.                duplicated. The duplication may be terminated at any
  571.  
  572.  
  573.                time with a STOPDUP pseudo op. A dupcount of zero
  574.  
  575.  
  576.                results in no assembly of the block of code.
  577.  
  578.  
  579.  
  580.                    DUP blocks may be nested up to 5 levels by using a
  581.  
  582.  
  583.                dupname on the DUP/ENDD pairs.
  584.  
  585.  
  586.  
  587.  
  588.  
  589.   EXAMPLES        DUP     10               REP4      DUP     4
  590.  
  591.  
  592.                   DS.B    1                          DS.L    1
  593.  
  594.  
  595.                   ENDD                               DC      20
  596.  
  597.  
  598.                                            REP4      ENDD
  599.  
  600.  
  601.  
  602.  
  603.  
  604.  
  605.  
  606.  
  607.  
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630. MAC.68K                                  -26-
  631.  
  632.  
  633.  
  634. MAC.68K
  635.  
  636.  
  637.  
  638.  
  639.  
  640.                                 ECHO
  641.                                 ECHO
  642.                                 ECHO
  643.  
  644.  
  645.  
  646.  
  647.  
  648.   PURPOSE         To duplicate a block of code while supplying arguments
  649.  
  650.  
  651.                for inline parameter substitution.
  652.  
  653.  
  654.  
  655.  
  656.  
  657.   FORMAT               ECHO   lnct,p1=(list1)
  658.  
  659.  
  660.              dupname   ECHO   ,p1=(list1),p2=(list2),...
  661.  
  662.  
  663.  
  664.  
  665.  
  666.   DESCRIPTION     ECHO marks the beginning of a block of code
  667.  
  668.  
  669.                specified by the optional line count field lnct, or
  670.  
  671.  
  672.                terminated by an ENDD when no line count field is
  673.  
  674.  
  675.                supplied. Up to 127 parameter names with variable
  676.  
  677.  
  678.                length lists may be used. The block is duplicated the
  679.  
  680.  
  681.                number of times equal to the shortest argument count
  682.  
  683.  
  684.                present in any of the lists.  The duplication may be
  685.  
  686.  
  687.                terminated at any time with a STOPDUP pseudo op. A
  688.  
  689.  
  690.                list with no arguments results in no assembly of the
  691.  
  692.  
  693.                block of code.
  694.  
  695.  
  696.  
  697.                    Parameter names and substitution rules are the
  698.  
  699.  
  700.                same as for MACRO. Null arguments are allowed, and
  701.  
  702.  
  703.                arguments may be embedded within parenthesis pairs.
  704.  
  705.  
  706.  
  707.                    ECHO blocks may be nested up to 5 levels by using
  708.  
  709.  
  710.                a dupname on the ECHO/ENDD pairs.
  711.  
  712.  
  713.  
  714.  
  715.  
  716.   EXAMPLES        ECHO    1,CC=(A,B,C)
  717.  
  718.  
  719.                   DC.B    'CC'
  720.  
  721.  
  722.  
  723.                   ECHO    ,AA=(1,1,2),BB=(A,B,C2)
  724.  
  725.  
  726.                   DS.B    AA
  727.  
  728.  
  729.                   DC.B    'BB'
  730.  
  731.  
  732.                   ENDD
  733.  
  734.  
  735.  
  736.  
  737.  
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748.  
  749.  
  750.  
  751.  
  752.                               -27-                              MAC.68K
  753.  
  754.  
  755.  
  756.                                                                 MAC.68K
  757.  
  758.  
  759.  
  760.  
  761.  
  762.                                 ELSE
  763.                                 ELSE
  764.                                 ELSE
  765.  
  766.  
  767.  
  768.  
  769.  
  770.   PURPOSE         To reverse the current state of an IF test.
  771.  
  772.  
  773.  
  774.  
  775.  
  776.   FORMAT                ELSE                        ELSE    lnct
  777.  
  778.  
  779.                ifname   ELSE               ifname   ELSE    lnct
  780.  
  781.  
  782.  
  783.  
  784.  
  785.   DESCRIPTION     An ELSE is used to stop assembly and begin skipping
  786.  
  787.  
  788.                source lines within an IF block, or to stop skipping
  789.  
  790.  
  791.                source lines and resume assembly. A named ELSE with an
  792.  
  793.  
  794.                ifname that matches the current skip ifname, or an
  795.  
  796.  
  797.                unnamed ELSE stops source line skipping started by an
  798.  
  799.  
  800.                IF, SKIP, or another ELSE.
  801.  
  802.  
  803.  
  804.                    If a line count lnct is specified, then an ELSE
  805.  
  806.  
  807.                that stops assembly ignores the next lnct lines.
  808.  
  809.  
  810.                Otherwise the assembly ignores lines until an unnamed
  811.  
  812.  
  813.                ENDC, an ENDC with a matching ifname, or another ELSE
  814.  
  815.  
  816.                is encountered.
  817.  
  818.  
  819.  
  820.  
  821.  
  822.   EXAMPLES
  823.  
  824.  
  825.  
  826.     IFEQ    OPT,10          IFEQ    OPT,10          FOO   IFEQ    OPT,10
  827.  
  828.  
  829.     MOVEQ   #1,D0           MOVEQ   #1,D0                 MOVEQ   #1,D0
  830.  
  831.  
  832.     ELSE                    ELSE    1               FOO   ELSE
  833.  
  834.  
  835.     MOVEQ   #2,D0           MOVEQ   #2,D0                 MOVEQ   #2,D0
  836.  
  837.  
  838.     ENDC                                            FOO   ENDC
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864. MAC.68K                                  -28-
  865.  
  866.  
  867.  
  868. MAC.68K
  869.  
  870.  
  871.  
  872.  
  873.  
  874.                                 END
  875.                                 END
  876.                                 END
  877.  
  878.  
  879.  
  880.  
  881.   PURPOSE         To signal the end of program text.
  882.  
  883.  
  884.  
  885.  
  886.   FORMAT               END
  887.  
  888.  
  889.  
  890.  
  891.   DESCRIPTION     END terminates the assembly of a program. It is a
  892.  
  893.  
  894.                required card and an error will be flagged if an end
  895.  
  896.  
  897.                of source file input is reached without an END card.
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904.  
  905.  
  906.  
  907.                                 ENDC
  908.                                 ENDC
  909.                                 ENDC
  910.  
  911.  
  912.  
  913.  
  914.   PURPOSE         To terminate source line skipping and resume assembly.
  915.  
  916.  
  917.  
  918.  
  919.   FORMAT               ENDC
  920.  
  921.  
  922.              ifname    ENDC
  923.  
  924.  
  925.  
  926.  
  927.   DESCRIPTION     ENDC terminates source line skipping. If skipping
  928.  
  929.  
  930.                is not active ENDC has no effect. If skipping is being
  931.  
  932.  
  933.                done with a line count, the ENDC is counted as a line
  934.  
  935.  
  936.                but otherwise has no effect. A named ENDC terminates
  937.  
  938.  
  939.                skipping only if its name matches the active ifname.
  940.  
  941.  
  942.  
  943.  
  944.  
  945.   EXAMPLES        IFEQ    X                          IFEQ    X
  946.  
  947.  
  948.                   MOVE    A2,D1                      MOVE    A2,D1
  949.  
  950.  
  951.                   ELSE    6                          ELSE
  952.  
  953.  
  954.                   IFEQ    Z                  FOO     IFEQ    Z
  955.  
  956.  
  957.                   MOVE    A3,D1                      MOVE    A3,D1
  958.  
  959.  
  960.                   ELSE    2                  FOO     ELSE    2
  961.  
  962.  
  963.                   MOVE    A4,A1                      MOVE    A4,D1
  964.  
  965.  
  966.                   ENDC                               ENDC
  967.  
  968.  
  969.  
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.                               -29-                              MAC.68K
  983.  
  984.  
  985.